//
//  Router.swift
//  JWBaseLib
//
//  Created by 周季伟 on 2017/12/12.
//  Copyright © 2017年 周季伟. All rights reserved.
//

public enum Mode {
    case test
    case production
}
class Router {
    var mode: Mode = .test
    var testServer = "https://api.douban.com/"               // 测试服务器地址
    var productionServer = "https://production.com"   // 正式服务器地址
    var server: String {
        switch mode {
        case .test:
            return testServer
        case .production:
            return productionServer
        }
    }
    func resourceBy(_ suffix: String) -> String {
        return (server as NSString).strings(byAppendingPaths: [suffix]).first! as String
    }
}
